<template> 
    <span>
        <span v-if="licenseInfo">{{licenseInfo.expire}}</span>
    </span>
</template>

<script setup> 
import { getCurrentInstance,ref, defineProps,onMounted } from 'vue';
import { useUserStore } from '../stores/user'
import { useLicenseStore } from '../stores/license'
import { getMyThemeSiteList } from '../api/api' 
import { useRouter } from 'vue-router'
const router = useRouter()
const app = getCurrentInstance()
const userStore = useUserStore() 
const licenseStore = useLicenseStore()   
const props = defineProps({
  onClick: Function
});
//在线验证
async function getMyTheme(){ 
     getMyThemeSiteList({pageNo:1,pageSize:2}).then(res => {
      if(res.code=='200'&&res.data){ 
        if(licenseStore.license&&!licenseStore.getAuth()){
          // app?.proxy?.$Bus.emit('SystemInfoMsg', {msg:"请先完成授权！"})
          return;
        }
        if(res.data.datas&&res.data.datas.length>1){ 
          router.push("/theme")
        }else if(res.data.datas&&res.data.datas.length==1){ 
          let theme=res.data.datas[0]; 
          setTimeout(function(){
            app?.proxy?.$Bus.emit('ShowThemeWebURL', {url:theme.url})  
          },5000) 
        }
      } 
    }) 
}

getMyTheme();
</script>

<style scoped> 
</style>